
'use strict';

/**
	Part of Zombie Navigator
	Copyright © 2016  Zombie Navigator Developers
	
	@file
	@license AGPL-3.0+
*/


/*
	Zombie script example (= unprivileged)
	Do NOT require () this script from the addon code.
*/


const {zombie, console} = require('zombie/zombie');
const {openWindow, openPrivateWindow, closeAll} = require('zombie/webbrowser');
const {run, delay} = require('zombie/async');


run(function* () {
	let w = yield openPrivateWindow('about:addons');
	
	console.log(w);
	console.log(w.uri);
	yield w.runScript(function (addonID) {
		AddonManager.getAddonByID(
			addonID
			, addon => {
				unsafeWindow.gViewController.commands.cmd_showItemDetails
					.doCommand(addon, true);
			}
		);
	}, '@zombie-navigator');
	yield delay(3);
	console.log(yield w.screenshot());
	
	console.log('Done!');
	closeAll();
});


// vim: ts=4 noet ai

